# -*- coding: utf-8 -*-
# @Time    : 2021/4/15 16:28
# @Author  : Chen
# @Email   : 2356458272@qq.com
# @File    : 密码.py
# @Software: PyCharm
import string
#长度
def leng(c):
    global b
    if len(c) > 8:
        b+=1
    else:
        d.append('长度需要超过8位')

#组成
def zc(c):
    global b
    c = list(c)
    e = 0
    f = 0
    g = 0
    for i in c:
        if i.isdigit():
            e=1
        elif i in list(string.ascii_uppercase):
            f =1
        elif i in list(string.ascii_lowercase):
            g =1
        else:
            h =1
    j = e + f + g
    if j >=3:
        b+=1
    else:
        d.append('密码没有由三种以上字符组成')

#重复
def cf(c):
    global b
    k = 0
    i = 0
    j = 3
    while j<=len(c)-3:
        f = c[i:j]
        x = i+3
        y = j+3
        i +=1
        j +=1
        while y <= len(c):
            g = c[x:y]
            if f == g:
                k+=1
            x += 1
            y += 1

    if k >0:
        d.append("重复")
    else:
        b+=1

#主程序
a = input("请输入密码：")
b = 2
d = []
leng(a)
zc(a)
cf(a)
if b != 5:
    print(f"评分等级{b},改进点：{d}")
else:
    print(f"评分等级{b},无需改进")

